package com.realtyManage.springboot.Dao;


import com.realtyManage.springboot.Model.Do.Banner;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BannerRepository extends JpaRepository<Banner, Integer>, JpaSpecificationExecutor<Banner> {

    List<Banner> findByState(int state);

    @Query("select b from Banner b where b.state = ?1 and b.area like %?2%")
    List<Banner> findByStateAndAreaLike(int state,String area);
}
